<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<input type="text" name="" id="a1" value="" />
		<select id="fuhao">
			<option value="+">+</option>
			<option value="-">-</option>
			<option value="*">*</option>
			<option value="/">/</option>
			<input type="text" name="" id="a2" value="" />
			<button type="button" onclick="jisuan()">计算</button>
			<input type="text" id="a3" value="" />
		</select>
	</body>
	<script type="text/javascript">
		function jisuan(){
			var a=document.getElementById('fuhao').value
			var b=document.getElementById('a1').value
			var c=document.getElementById('a2').value
			 
			if(a=='+'){
				var d = parseFloat(b) + parseFloat(c); 
				document.getElementById('a3').value=d.toFixed(2)
			}else if(a=='-'){
				var d = parseFloat(b) - parseFloat(c);
				document.getElementById('a3').value=d.toFixed(2)
			}
			else if(a=='*'){
				var d = parseFloat(b) * parseFloat(c);
				document.getElementById('a3').value=d.toFixed(2)
			}
			else if(a=='/'){
				var d = parseFloat(b) / parseFloat(c);
				document.getElementById('a3').value=d.toFixed(2)
			}
		}
	</script>
</html>
